fn example() {
    /*
    //两个 开端
    for n in 1..101 {
        if n % 15 == 0 {
            println!("fizzbuzz");
        }else if n % 3 == 0 {
            println!("fizz");
        }else  if n%5 == 0 {
            println!("buzz");
        }else{
            println!("{}",n);
        }

    }
    */

    //两个 闭端
    for n in 1..=100 {
        if n % 15 ==0 {
            println!("fizzbuzz");
        }else if n % 3 == 0 {
            println!("fizz");
        }else  if n%5 == 0 {
            println!("buzz");
        }else{
            println!("{}",n);
        }

    }

    let names = vec!["Bob","Frank","Ferris"];
    for name in names.iter() {
        match name {
            &"Ferris" => println!("This is arustacean among  us"),
            _ =>println!("Hello {}",name),
        }
    }

    //集合中的数据会被消耗，一旦被消耗就无法使用了再
    for name in names.into_iter() {
        match mame {
            "Ferris" => println!("There is a rustacean among us!"),
            _ => println!("Hello {}",name),
        }
    }
/*
    Hello Bob
    Hello Frank
    There is a rustacean among us!
*/
    //元素修改
    for name in names.iter_mut() {
        *name = match name {
            &mut "Ferris" => "Thereis a rustacean among us!",
            _ => "Hello",
        }
    }
    //names: ["Hello", "Hello", "There is a rustacean among us!"]

}